<?php
   class Permission extends AppModel {
        var $alias  =   'Permission';
        var $name = 'Permission';
        var $useTable = 'user_aro_aco';
        var $belongsTo  =   array(
            'Usergroup'   =>  array(
                'className'     =>  'Usergroup',
                'foreignKey'    =>  'aro_id',
                'fields'    =>  array('Usergroup.id', 'Usergroup.title')
            ),
            'Useraction'   =>  array(
                'className'     =>  'Useraction',
                'foreignKey'    =>  'aco_id',
                'fields'    =>  array('Useraction.id', 'Useraction.title')
            ),
        );
        function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
            $parameters = compact('conditions');
            $this->recursive = $recursive;
            $count = $this->find('count', array_merge($parameters, $extra));
            if (isset($extra['group'])) {
                $count = $this->getAffectedRows();
            }
            return $count;
        }


    }


?>
